import request from "@/utils/request.js"

const name="resale"

export default {
  getList(){
    return request({
      url:'/resale',
      method:'get'
    });
  },
  findAll(type,page,size){
    return request({
      url:`/${name}/${type}/${page}/${size}`,
      method:'get'
    });
  },
  search(searchMap,page,size){
    return request({
      url:`/${name}/search/${page}/${size}`,
      method:'post',
      data:searchMap
    });
  },
  save(pojo){
    return request({
      url:`/${name}`,
      method:'post',
      data:pojo
    });
  },
  findById(id){
    return request({
      url:`/${name}/${id}`,
      method:'get',
    });
  },
  update(id,pojo){
    if(id==null||id==''){
      return this.save(pojo)
    }
    return request({
      url:`/${name}/${id}`,
      method:'put',
      data:pojo
    });
  },
  deleteById(id){
    return request({
      url:`/${name}/${id}`,
      method:'delete',
    });
  }
}
